/**
 * Copyright (c) 2006-2015 Hzins Ltd. All Rights Reserved.
 * <p>
 * This code is the confidential and proprietary information of
 * Hzins. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Hzins,http://www.hzins.com.
 */
package com.huize.ladon.apm.common.constant;

/**
 * 常量定义
 *
 * @author hz15051315
 * @date 2019年2月26日 上午10:18:18
 */
public final class Constants {

    /**
     * {@code 200 OK} (HTTP/1.0 - RFC 1945)
     */
    public static final int SC_OK = 200;

    /**
     * <tt>302 Moved Temporarily</tt> (Sometimes <tt>Found</tt>) (HTTP/1.0 - RFC 1945)
     */
    public static final int SC_MOVED_TEMPORARILY = 302;

    /**
     * token名称尾缀
     */
    public static final String TOKEN_NAME = "token";

    /**
     * 浑天hzins.com根域名
     */
    public static final String DOMAIN_HZINS_COM = "hzins.com";
    /**
     * http请求头部referer地址
     */
    public static final String REFERER = "referer";

    /**
     * UTF8编码
     **/
    public static final String UTF8 = "UTF-8";

    /**
     * 消息交换机
     */
    public final static String DEFAULT_TRACE_EXCHANGE = "ladon_apm_trace_exchange";

    /**
     * 消息队列名
     */
    public final static String DEFAULT_TRACE_QUEUE = "ladon_apm_collector_queue";


    /***************************** Trace调用常量定义 ***************************/
    /**
     * root根节点spanId
     */
    public static final int SPAN_ROOT_CHAR = 0;

    public static final int DEFAULT_SPAN_LEAF_ID = 1;

    public static final String EMPTY_CHARSET = "";

    public static final String IP_SPLIT_CHAR = "\\.";

    /**
     * 默认byte，就是常量1
     */
    public static final byte DEFAULT_RESULT_BYTE = 0x1;

    /**
     * 空格，十六进制，byte位数不足，则用它补足
     */
    public static final byte SPACE_BYTE = 0x20;

    /**
     * 空格，字符串，拆包后需要去除字符串头尾的空格
     */
    public static final String SPACE_String = " ";

    public static final String BEAN_TO_JSON_EXCEPTION = "bean convert json exception";

    public static final int DEFAULT_COLLECTOR_QUEUE_SIZE = 12048;

    public static final long DEFAULT_POLL_MILLISECONDS = 500;

    public static final long DEFAULT_THREAD_JOIN_MILLISECONDS = 5000;

    public static final int DEFAULT_INTERVAL_TIME = 1000;

    public static final String ATTACHMENT_TRACE_ID_KEY = "trace-id";

    public static final String ATTACHMENT_SPAN_ID_KEY = "span-id";

    public static final String ATTACHMENT_SAMPLE_SWITCH = "sample-switch";

    public static final String CONTEXT_TRACE_MESSAGE_KEY = "catfish-trace-message";

    public static final String PROVIDER_TRACE_TAG_KEY = "trace-provider-tag";
}
